<?php

declare(strict_types=1);

namespace app\listener;

use app\event\UserRegistered;

class SendWelcomeEmail
{
    /**
     * 处理事件
     *
     * @param  UserRegistered  $event
     * @return void
     */
    public function handle(UserRegistered $event): void
    {
        $user = $event->getUser();
        // 实现发送欢迎邮件的逻辑
        // Mail::to($user->email)->send(...);
        // echo "Sending welcome email to {$user->email}\n"; // 示例输出
    }
}